<template>
  <div>
    <h4>眼科疾病</h4>
    <el-form :model="sizeForm" label-width="80px" size="mini">
      <el-form-item label="诊断名称:">
        <el-checkbox-group v-model="sizeForm.diagnosisName" @change="handleChecked">
          <el-checkbox label="1" name="diagnosisName">白内障</el-checkbox>
          <el-checkbox label="2" name="diagnosisName">青光眼</el-checkbox>
          <el-checkbox label="3" name="diagnosisName">结膜炎</el-checkbox>
          <el-checkbox label="4" name="diagnosisName">虹膜炎</el-checkbox>
        </el-checkbox-group>
      </el-form-item>
      <h5 v-show="nameValue.indexOf('1') !== -1">白内障</h5>
      <year-and-medical v-show="nameValue.indexOf('1') !== -1" ref="baineizhang" />
      <h5 v-show="nameValue.indexOf('2') !== -1">青光眼</h5>
      <year-and-medical v-show="nameValue.indexOf('2') !== -1" ref="qingguangyan" />
      <h5 v-show="nameValue.indexOf('3') !== -1">结膜炎</h5>
      <year-and-medical v-show="nameValue.indexOf('3') !== -1" ref="jiemoyan" />
      <h5 v-show="nameValue.indexOf('4') !== -1">虹膜炎</h5>
      <year-and-medical v-show="nameValue.indexOf('4') !== -1" ref="hongmoyan" />
    </el-form>
    <el-divider />
  </div>
</template>

<script>
import YearAndMedical from './YearAndMedical.vue'
export default {
  components: {
    YearAndMedical
  },
  data() {
    return {
      sizeForm: {
        id: '',
        diagnosisName: [
          '1'
        ],
        diseaseName: '6',
        pid: this._routerRoot._route.query.id,
        pastDiseaseInfoDtos: []
      },
      nameValue: [
        '1'
      ]
    }
  },
  created() {
    this.nameValue = this.sizeForm.diagnosisName
  },
  methods: {
    onSubmit() {
      console.log('submit!')
    },
    handleChecked(v) {
      this.nameValue = v
    }
  }
}
</script>

<style>

</style>
